3.705 \(\int \frac {a^2-b^2 \sec ^2(c+d x)}{a+b \sec (c+d x)} \, dx\)

Optimal. Leaf size=17 \[ a x-\frac {b \tanh ^{-1}(\sin (c+d x))}{d} \]

[Out]

a*x-b*arctanh(sin(d*x+c))/d

________________________________________________________________________________________

Rubi [A]  time = 0.04, antiderivative size = 17, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 30, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.067, Rules used = {4042, 3770} \[ a x-\frac {b \tanh ^{-1}(\sin (c+d x))}{d} \]

Antiderivative was successfully verified.

[In]

Int[(a^2 - b^2*Sec[c + d*x]^2)/(a + b*Sec[c + d*x]),x]

[Out]

a*x - (b*ArcTanh[Sin[c + d*x]])/d

Rule 3770

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rule 4042

Int[((A_.) + csc[(e_.) + (f_.)*(x_)]^2*(C_.))*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_.), x_Symbol] :> Dist[
C/b^2, Int[(a + b*Csc[e + f*x])^(m + 1)*Simp[-a + b*Csc[e + f*x], x], x], x] /; FreeQ[{a, b, e, f, A, C, m}, x
] && EqQ[A*b^2 + a^2*C, 0]

Rubi steps

\begin {align*} \int \frac {a^2-b^2 \sec ^2(c+d x)}{a+b \sec (c+d x)} \, dx &=-\int (-a+b \sec (c+d x)) \, dx\\ &=a x-b \int \sec (c+d x) \, dx\\ &=a x-\frac {b \tanh ^{-1}(\sin (c+d x))}{d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.01, size = 17, normalized size = 1.00 \[ a x-\frac {b \tanh ^{-1}(\sin (c+d x))}{d} \]

Antiderivative was successfully verified.

[In]

Integrate[(a^2 - b^2*Sec[c + d*x]^2)/(a + b*Sec[c + d*x]),x]

[Out]

a*x - (b*ArcTanh[Sin[c + d*x]])/d

________________________________________________________________________________________

fricas [B]  time = 0.46, size = 36, normalized size = 2.12 \[ \frac {2 \, a d x - b \log \left (\sin \left (d x + c\right ) + 1\right ) + b \log \left (-\sin \left (d x + c\right ) + 1\right )}{2 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a^2-b^2*sec(d*x+c)^2)/(a+b*sec(d*x+c)),x, algorithm="fricas")

[Out]

1/2*(2*a*d*x - b*log(sin(d*x + c) + 1) + b*log(-sin(d*x + c) + 1))/d

________________________________________________________________________________________

giac [B]  time = 0.24, size = 43, normalized size = 2.53 \[ \frac {{\left (d x + c\right )} a - b \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) + b \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right )}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a^2-b^2*sec(d*x+c)^2)/(a+b*sec(d*x+c)),x, algorithm="giac")

[Out]

((d*x + c)*a - b*log(abs(tan(1/2*d*x + 1/2*c) + 1)) + b*log(abs(tan(1/2*d*x + 1/2*c) - 1)))/d

________________________________________________________________________________________

maple [A]  time = 0.62, size = 31, normalized size = 1.82 \[ a x -\frac {b \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{d}+\frac {c a}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a^2-b^2*sec(d*x+c)^2)/(a+b*sec(d*x+c)),x)

[Out]

a*x-1/d*b*ln(sec(d*x+c)+tan(d*x+c))+1/d*c*a

________________________________________________________________________________________

maxima [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: ValueError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a^2-b^2*sec(d*x+c)^2)/(a+b*sec(d*x+c)),x, algorithm="maxima")

[Out]

Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'a
ssume' command before evaluation *may* help (example of legal syntax is 'assume(4*a^2-4*b^2>0)', see `assume?`
 for more details)Is 4*a^2-4*b^2 positive or negative?

________________________________________________________________________________________

mupad [B]  time = 3.69, size = 57, normalized size = 3.35 \[ \frac {2\,a\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}-\frac {2\,b\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a^2 - b^2/cos(c + d*x)^2)/(a + b/cos(c + d*x)),x)

[Out]

(2*a*atan(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2)))/d - (2*b*atanh(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2)))/d

________________________________________________________________________________________

sympy [A]  time = 2.72, size = 41, normalized size = 2.41 \[ a x - b \left (\begin {cases} \frac {x \left (\tan {\relax (c )} \sec {\relax (c )} + \sec ^{2}{\relax (c )}\right )}{\tan {\relax (c )} + \sec {\relax (c )}} & \text {for}\: d = 0 \\\frac {\log {\left (\tan {\left (c + d x \right )} + \sec {\left (c + d x \right )} \right )}}{d} & \text {otherwise} \end {cases}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a**2-b**2*sec(d*x+c)**2)/(a+b*sec(d*x+c)),x)

[Out]

a*x - b*Piecewise((x*(tan(c)*sec(c) + sec(c)**2)/(tan(c) + sec(c)), Eq(d, 0)), (log(tan(c + d*x) + sec(c + d*x
))/d, True))

________________________________________________________________________________________